# -*- coding: utf-8 -*-
P,A=raw_input().split(' ')
_pg,_ps,_pk=map(int,P.split('.'))
_ag,_as,_ak=map(int,A.split('.'))

charges = _pg*17*29 + _ps*29 + _pk \
        - _ag*17*29 - _as*29 - _ak

flag=False
if charges < 0:
    charges *= -1
    flag=True
cg = charges / (17*29)
cs = charges % (17*29) / 29
ck = charges % (17*29) % 29
if flag:
    print str(cg)+'.'+str(cs)+'.'+str(ck)
else:
    print str(-1*cg)+'.'+str(cs)+'.'+str(ck)